#!/bin/sh

echo "[INFO] [$(date '+%Y-%m-%d %H:%M:%S')] application ht-3d-editor."

if [ -n "$SIDServiceWhiteList" ]; then
    sed -i "s#SIDServiceWhiteList =.*#SIDServiceWhiteList = $SIDServiceWhiteList#" /home/ht-3d-editor/server/config.ini
fi

if [ -n "$WAIT_HOSTS" ]; then
    echo "[INFO] 检测依赖环境."
    chmod +x /wait
    /wait
fi

# 文件打开数量限制(swarm 模式不支持此参数)
# sysctl -w fs.inotify.max_user_watches=524288

exec "$@"